package cn.jee.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;

@ControllerAdvice
public class GlobalExceptionHandler {

  @ExceptionHandler(IOException.class)
  @ResponseBody
  public String handleIOException(IOException ex) {
    return "文件上传失败：" + ex.getMessage();
  }
}
